package com.blb.mapper;

import com.blb.pojo.CooperativePartner;
import com.blb.pojo.IndustryManagement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;


import java.util.List;

@Repository
@Mapper
public interface CooperativePartnerDao {
    int deleteByPrimaryKey(Integer cooperativeId);

    int insert(CooperativePartner record);

    int insertSelective(CooperativePartner record);

    CooperativePartner selectByPrimaryKey(Integer cooperativeId);

    int updateByPrimaryKeySelective(CooperativePartner record);

    int updateByPrimaryKey(CooperativePartner record);


    /**
     * @return
     * @author hxf
     * 查询所有IndustryManagement对象，sql语句做了限制，防止前端图片获取过多影响布局，之战是前8个
     */
    @Select("select * from industry_management limit 0,8")
    List<IndustryManagement> selectIndustryIcon();

    /**
     * @param id
     * @return
     * @author hxf
     * 根据id查看行业、所有公司logo和伙伴名称
     */
    @Select("select cp.* from cooperative_partner cp where cp.industry_id = #{id}")
    List<CooperativePartner> selectCP(@Param("id") Integer id);


    /**
     * @param page 展示第几页
     * @param size 每页展示条数
     * @return
     * @author hxf
     * 分页
     */
    List<CooperativePartner> selectAllLogo(@Param("page") Integer page, @Param("size") Integer size);
}